<%
  use crate::utils::config;
  use crate::utils::urls;

  let home_uri = if config::standalone_dashboard() {
    urls::deployment_notebooks()
  } else {
    "/deployments".to_string()
  };
%>

<nav>
  <nav aria-label="breadcrumb z-1">
    <ol class="breadcrumb">
      <li class="breadcrumb-item body-regular-text <% if links.is_empty() {%>active<% } %>">
        <a class="d-flex gap-2 align-items-center" href="<%- home_uri %>">
          <span class="icon-owl icomoon"></span>
          Home
        </a>
      </li>

      <% if !links.is_empty() {%>
      <div class="vr my-1 mx-2"></div>
      <% } %>

      <% for link in links {
        let active = if link.active {
          "active"
        } else {
          ""
        };
  
        let area = if link.active {
          r#"aria-current="page""#
        } else {
          ""
        };
  
      %>
      <li class="breadcrumb-item body-regular-text <%= active %>" <%- area %>>
        <a href="<%= link.href %>">
          <%= link.name %>
        </a>
        <% if active.is_empty() { %>
        <div class="vr my-1 ms-2"></div>
        <% } %>
      </li>
      <% } %>
    </ol>
  </nav>
</nav>
